
# 条件判断
#age = input()
#age = int(age)      # 把字符串转为整型
age = 3
if age < 5:
    print('hi')
    print('baby')
elif age == 5:
    print('hei')
    print('teenager')
else:
    print('hello')
    print('adult')

# 循环, break和continue 与c中含义相同
mates = ['sky']
mates.append('cherry')
mates.insert(1, 'lotus')
mates.append("hello")
for mate in mates:
    print(mate)

sum = 0
arr = range(101)    # 生成0-100之间的101个整型序列
for x in arr:
    sum += x
print(arr)
print(list(arr))
print('for sum = %d' % sum)


sum = 0
x = 0
while x < 101:
    if x == 50:
        x += 1
        continue
    sum += x
    x += 1

print('while sum = %d' % sum)
